import React from 'react';
import { Redirect } from "react-router-dom"
const Discover = React.lazy(_ => import("../pages/discover"))
const Album = React.lazy(_ => import("../pages/discover/children-pages/album"))
const Artist = React.lazy(_ => import("../pages/discover/children-pages/artist"))
const Djradio = React.lazy(_ => import("../pages/discover/children-pages/djradio"))
const Ranking = React.lazy(_ => import("../pages/discover/children-pages/ranking"))
const Recommend = React.lazy(_ => import("../pages/discover/children-pages/recommend"))

const Friend = React.lazy(_ => import("../pages/friend"))
const My = React.lazy(_ => import("../pages/my"))
const Songs = React.lazy(_ => import("../pages/discover/children-pages/songs"))
const Player = React.lazy(_ => import("../components/player"))

// import Discover from "../pages/discover"
// import Album from '../pages/discover/children-pages/album';
// import Artist from '../pages/discover/children-pages/artist';
// import Djradio from '../pages/discover/children-pages/djradio';
// import Ranking from '../pages/discover/children-pages/ranking';
// import Recommend from '../pages/discover/children-pages/recommend';
// import Friend from "../pages/friend"
// import My from "../pages/my"
// import Songs from '../pages/discover/children-pages/songs';
// import Player from '../components/player';
const routes = [
    {
        path: "/",
        //精准匹配
        exact: true,
        //重定向
        render: () => {
            return <Redirect to="/discover" />
        }
    },
    {
        path: "/discover",
        component: Discover,
        routes: [
            {
                path: "/discover",
                //精准匹配
                exact: true,
                //重定向
                render: () => {
                    return <Redirect to="/discover/recommend" />
                }
            },
            {
                path: '/discover/recommend',
                component: Recommend
            },
            {
                path: '/discover/album',
                component: Album
            },
            {
                path: '/discover/artist',
                component: Artist
            },
            {
                path: '/discover/djradio',
                component: Djradio
            },
            {
                path: '/discover/ranking',
                component: Ranking
            },
            {
                path: '/discover/songs',
                component: Songs
            },
        ]
    },
    {
        path: "/my",
        component: My
    },
    {
        path: "/friend",
        component: Friend
    },
    {
        path: "/player",
        component: Player
    }

]
export default routes